-
Notifications
You must be signed in to change notification settings - Fork 691
Add cleanup IO process after nerdctl stop #4316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
can we have a test please ? |
Sure |
87c6d21
to
2689504
Compare
// Stop the container after 2 seconds | ||
go func() { | ||
time.Sleep(2 * time.Second) | ||
base.Cmd("stop", testContainerName).Run() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sequentially stopping the container makes things more deterministic. AssertOk
here is necessary to ensure proper stop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sequentially stopping the container makes things more deterministic.
AssertOk
here is necessary to ensure proper stop
Thanks! Since the container is long-running with --rm, we use a goroutine to trigger stop — otherwise run blocks and we can’t proceed. Already updated the stop call to use AssertOK to ensure it completes properly.
Hey @liuchangyan Looks like the new tests are failing? |
I can help to create a ci for this bug. |
@ningmingxiao please go ahead |
I think we should mv io.close in waitContainerStop it will make sure container is really stopped.
|
Hi @liuchangyan, What is the next step for this PR? |
|
Fix #4315
In the
ctr
andCRI
call paths ofcontainerd
, the remainingFIFO
files(e.g., /run/containerd/fifo)
are primarily cleaned up through theDelete
interface of thetask
. However, in thenerdctl stop
path, this interface is not invoked, so an explicit call toio.Close
is required to clean them up.